
import http from '@/utils/http.js'
import api from '@/api/api.js'

const state = {
	
	// 整个屏幕高度，小程序由于有，所以不太一样需要-128
	// #ifdef MP-WEIXIN
	fullHeight: ( 750 * uni.getSystemInfoSync().windowHeight / uni.getSystemInfoSync().windowWidth) - 128 + 'rpx',
	// #endif
	// #ifdef H5
	fullHeight: ( 750 * uni.getSystemInfoSync().windowHeight / uni.getSystemInfoSync().windowWidth)+ 'rpx',
	// #endif
	
	appName: '小程序名称',
	logo: 'https://phonics-1253604546.cos.ap-beijing.myqcloud.com/UTOOLS1587742832987.jpeg',
	
	homeBanner: []
}

const mutations = {
	SET_HOME_BANNER: (state, banner) => {
	  state.homeBanner = banner
	}
}

const actions = {
	
	getHomeBanner({ commit }, param) {
		return http.getAction(
			api.homeBanner, 
			param, 
			(data) => commit('SET_HOME_BANNER', data)
		)
	},
	
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}